﻿Imports EnvDTE


Public Class ProjectHolder
  Implements IComparable(Of ProjectHolder)

  Public Property UpperPath As String
  Public Property Project As Project
  Public ReadOnly Property FullName As String
    Get
      If String.IsNullOrEmpty(UpperPath) Then
        Return Project.Name
      Else
        Return System.IO.Path.Combine(UpperPath, Project.Name)
      End If
    End Get
  End Property

  Public Function CompareTo(other As ProjectHolder) As Integer Implements IComparable(Of ProjectFilesLinker.ProjectHolder).CompareTo
    Return Me.FullName.CompareTo(other.FullName)
  End Function

  Public Overrides Function ToString() As String
    Return "PH: {" + FullName + "}"
  End Function

  Public Overrides Function Equals(obj As Object) As Boolean
    If Not TypeOf obj Is ProjectHolder Then
      Return False
    Else
      Return Me.Project Is CType(obj, ProjectHolder).Project
    End If
  End Function

End Class
